﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Practice_Feb_12_2017
{
    class Program
    {
        static void Main(string[] args)
        {
            List<IExecutable> jobList = new List<IExecutable>()
            {
                new Student(),
                new Dekan()
            };

            Worker w = new Worker(jobList);
            w.Run();
        }
    }

    interface IExecutable
    {
        void Execute();
    }


    class Worker
    {

        List<IExecutable> jobs;

        public Worker(List<IExecutable> dogs)
        {
            jobs = dogs;
        }

        public void Run()
        {
            foreach (IExecutable j in jobs)
            {
                j.Execute();
            }
        }
    }

    class Student : IExecutable
    {
        public void Execute()
        {
            Console.WriteLine("Работа выполнена.");
        }
    }

    class Dekan : IExecutable
    {
        public void Execute()
        {
            Console.WriteLine("Вы отчислены.");
        }
    }

}
